<?php

// include function files for this application
require_once('paperclip_sc_fns.php');
session_start();

do_html_header("Updating paper clip");
display_shopping_menu($_SESSION['cat_array']);
display_cart_tool();
echo "<div id=\"right-area\">";
if (check_admin_user()) {
	if (filled_out($_POST)) {
		$oldsku = $_POST['oldsku'];
		$sku = $_POST['sku'];
		$clipname = $_POST['clipname'];
		$designer = $_POST['designer'];
		$catid = $_POST['catid'];
		$price = $_POST['price'];
		$description = $_POST['description'];

		if(update_paperclip($oldsku, $sku, $clipname, $designer, $catid, $price, $description)) {
			echo "<p>Paper clip was updated.</p>";
		} else {
			echo "<p>Paper clip could not be updated.</p>";
		}
	} else {
		echo "<p>You have not filled out the form.	Please try again.</p>";
	}
	
} else {
	echo "<p>You are not authorized to view this page.</p>";
}
do_html_footer();

?>
